package cn.sc.allinpay.allfavour.business.common.app;

import cn.sc.allinpay.allfavour.business.common.data.CashierData;
import cn.sc.allinpay.allfavour.business.common.data.ConfigData;
import cn.sc.allinpay.allfavour.business.common.data.PayInfo;
import cn.sc.allinpay.allfavour.business.common.data.PosInfo;
import cn.sc.allinpay.allfavour.business.common.data.SpToken;
import cn.sc.allinpay.allfavour.business.common.data.UserInfo;

/**
 * 全局业务变量
 * author：pany
 * on 2017/11/15 23:14
 */
public class Global {

    public PayInfo getPayInfo() {
        return payInfo;
    }

    public void setPayInfo(PayInfo payInfo) {
        this.payInfo = payInfo;
    }

    private static class GlobalHolder {
        /**
         * 单例对象实例
         */
        private static final Global INSTANCE = new Global();
    }

    //防止直接通过构造函数new
    private Global() {

    }

    public static final Global getInstance() {
        return GlobalHolder.INSTANCE;
    }

    /**
     * 收银员登录数据
     */
    private CashierData cashierData;

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    /**
     * 收银员登录数据
     */
    private UserInfo userInfo;

    /**
     * 支付数据
     */
    private PayInfo payInfo;

    /**
     * 万商惠本地程序配置的参数
     */
    private ConfigData configData;

    /**
     * 通联收银宝应用配置的参数
     */
    private PosInfo posInfo;
    /**
     * 商点请求 token
     */
    private SpToken token;

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    private String server;

    public SpToken getToken() {
        return token;
    }

    public void setToken(SpToken token) {
        this.token = token;
    }

    public CashierData getCashierData() {
        return cashierData;
    }

    public void setCashierData(CashierData cashierData) {
        this.cashierData = cashierData;
    }

    public ConfigData getConfigData() {
        return configData;
    }

    public void setConfigData(ConfigData configData) {
        this.configData = configData;
    }

    public PosInfo getPosInfo() {
        return posInfo;
    }

    public void setPosInfo(PosInfo posInfo) {
        this.posInfo = posInfo;
    }
}
